#@layout()

#define script()
<script>

    function doDel(id) {
        ajaxGet("#(CPATH)/admin/user/role/doDel/" + id);
    }

</script>
#end

#define content()
    <section class="content-header">
        <h1>
            会员管理
            <small>Members Management</small>
        </h1>
    </section>

    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">
                    <div class="card-header with-border">

                        <div class="row admin-search-panel">
                            <div class="col-12">
                                <a href="memberEdit" class="btn btn-primary ">
                                    <i class="fas fa-plus"></i> 新建
                                </a>
                            </div>
                        </div>

                    </div>
                    <!-- /.card-header -->
                    <div class="card-body p-0">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
                                    <input class="tableCheckAll" id="checkall" type="checkbox"/>
                                </th>
                                <th style="width: 30%">名称</th>
                                <th>描述</th>
                            </tr>
                            #for(role : roles)
                            <tr>
                                <td><input name="tableItem" type="checkbox" value="#(role.id)" />
                                </td>
                                <td>
                                    <strong>
                                        <a href="#(CPATH)/admin/user/role/edit/#(role.id)"> #(role.name ??) </a>
                                        #if(role.isSuperAdmin())
                                        （超级管理员）
                                        #end
                                    </strong>
                                    <div class="jp-action-card">
                                        <div class="jp-action-body">
                                            <a href="#(CPATH)/admin/user/role/edit/#(role.id)">编辑</a> |
                                            <a href="#(CPATH)/admin/user/role/permissions/#(role.id)">权限</a> |
                                            <a href="javascript:;" class="red-action"
                                               onclick="doDel('#(role.id)')">删除</a>
                                        </div>
                                    </div>
                                </td>
                                <td>#(role.description ??)</td>
                            </tr>
                            #else
                            <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                            #end
                            </tbody>
                        </table>
                    </div>
                    <!-- /.card-body -->
                    <div class="card-footer">
                        <div class="row">
                            <div class="col-sm-12">
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.card -->
            </div>
    </section>
#end
